import Sequelize from 'sequelize';
import baseDao from '../lib/baseDao.js'; // 数据库操作

const Modal = baseDao.sequelize.define('t_checkin', {
  // 属性
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true, // 主键
    autoIncrement: true, // 自增
    allowNull: true,
    validate: {
      len: [1, 50]
    }
  },
  userId: {
    type: Sequelize.INTEGER,
    allowNull: true,
    unique: true, // 唯一约束
    validate: {
      len: [0, 50]
    },
    comment: '签到者ID'
  },
  gold: {
    type: Sequelize.INTEGER,
    allowNull: true,
    validate: {
      len: [0, 5]
    },
    comment: '签到积分'
  },
}, {
    // 参数
  });

//向外暴露
export default {
  Modal,
}